package com.zego.wawaji.third.share.util;

import android.util.Log;

import com.tencent.tauth.IUiListener;
import com.tencent.tauth.UiError;
import com.zego.wawaji.third.share.ShareUtils;
import com.zego.wawaji.third.share.data.ShareData;

/**
 * QQ分享监听
 */
public class QQShareListener implements IUiListener {
    private ShareUtils.ShareCallBack shareCallBack;
    private ShareData shareData;

    public QQShareListener() {

    }

    public ShareUtils.ShareCallBack getShareCallBack() {
        return shareCallBack;
    }

    public void setShareCallBack(ShareUtils.ShareCallBack shareCallBack) {
        this.shareCallBack = shareCallBack;
    }

    public QQShareListener(ShareUtils.ShareCallBack shareCallBack) {
        this.shareCallBack = shareCallBack;
    }

    public void setShareData(ShareData shareData) {
        this.shareData = shareData;
    }

    @Override
    public void onError(UiError arg0) {
        Log.d("_test", "shareToQQ  onError");
//        shareData = ModuleMgr.getCommonMgr().getData().getShareData();
        shareCallBack.shareFail(shareData.getShareEnum(), shareData);
    }

    @Override
    public void onComplete(Object arg0) {
        Log.d("_test", "shareToQQ  onComplete");
//        shareData = ModuleMgr.getCommonMgr().getData().getShareData();
        shareCallBack.shareSuccess(shareData.getShareEnum(), shareData);
    }

    @Override
    public void onCancel() {
        Log.d("_test", "shareToQQ  onCancel");
    }
}
